package com.bookstore.service.serviceImpl;

import com.bookstore.bean.LoginForm;
import com.bookstore.bean.User;
import com.bookstore.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class UserService {
    @Autowired
    private UserDao userDao ;


    public User login(LoginForm loginForm) {
        return userDao.login(loginForm);
    }

    public User findByName(String userName){return  userDao.findByName(userName);}
    public void updateInfo(User user) {

    }
    public void addUser(LoginForm loginForm){userDao.addUser( loginForm);};

    public List<User> getAllUser() {
        return userDao.getAllUser();
    }
}
